// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 新增系统定时任务 POST /schedule/quartz/add */
export async function insertJobUsingPost(
  body: API.ScheduleJobVO,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/schedule/quartz/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除系统定时任务 POST /schedule/quartz/delete */
export async function deleteJobsUsingPost(body: string[], options?: { [key: string]: any }) {
  return request<API.TradeResult>('/schedule/quartz/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询系统定时任务列表 POST /schedule/quartz/list */
export async function fetchJobListUsingPost(
  body: API.PageBeanScheduleJobListQuery_,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/schedule/quartz/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 暂停系统定时任务 POST /schedule/quartz/pause */
export async function pauseJobUsingPost(body: API.ScheduleJobVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/schedule/quartz/pause', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 恢复系统定时任务 POST /schedule/quartz/resume */
export async function resumeJobUsingPost(
  body: API.ScheduleJobVO,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/schedule/quartz/resume', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 立即运行系统定时任务 POST /schedule/quartz/run */
export async function runJobUsingPost(body: API.ScheduleJobVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/schedule/quartz/run', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改系统定时任务 POST /schedule/quartz/update */
export async function updateJobCronUsingPost(
  body: API.ScheduleJobVO,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/schedule/quartz/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
